package com.hzbank.juc.review;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @description:
 * @author: libugu@cskaoyan.com
 * @date 2023/12/26 - 15:14
 */
@Slf4j
public class Test001 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        new Thread(()->log.debug("t1============"),"t1").start();
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                log.debug("t2-----------");
            }
        };
        new Thread(runnable,"t2").start();
        FutureTask<Integer> integerFutureTask = new FutureTask<Integer>(()->{
            return 100;
        });
        new Thread(integerFutureTask,"t3").start();
        Integer integer = integerFutureTask.get();
        String in = Integer.toString(integer);
        log.debug(in);
    }
}
